/**
 * 路由配置，集中管理
 * @imports {component}
 * @export {Router}
*/

import React from 'react'
import { Login, Home, NotFund, AddArticle, ArticleList } from '@src/views'
import { useRoutes, Navigate } from 'react-router-dom'

const Router = () => {
  const routes = useRoutes([
    {
      path: '/',
      element: <Home />,
      children: [
        {
          path: '/addarticle',
          element: <AddArticle />
        },
        {
          path: '/articlelist',
          element: <ArticleList />
        },
        {
          path: '/reviseArticle',
          element: <AddArticle />
        },
      ]
    },
    {
      path: '/login',
      element: <Login />
    },
    {
      path: '*',
      element: <NotFund />
    }
  ])
  return routes
}

export default Router